"""sqlite init

Revision ID: 235ac4e83ee4
Revises: 
Create Date: 2025-11-17 13:52:45.930308

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa
from datetime import date

# revision identifiers, used by Alembic.
revision: str = '235ac4e83ee4'
down_revision: Union[str, Sequence[str], None] = None
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    """Upgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('apscheduler_jobs',
                    sa.Column('id', sa.String(length=191), nullable=False),
                    sa.Column('next_run_time', sa.DOUBLE(), nullable=True),
                    sa.Column('job_state', sa.LargeBinary(), nullable=False),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index('ix_apscheduler_jobs_next_run_time', 'apscheduler_jobs', ['next_run_time'], unique=False)
    op.create_table('gen_table',
                    sa.Column('table_id', sa.Integer(), autoincrement=True, nullable=False, comment='编号'),
                    sa.Column('table_name', sa.String(length=200), server_default='', nullable=True, comment='表名称'),
                    sa.Column('table_comment', sa.String(length=500), server_default='', nullable=True,
                              comment='表描述'),
                    sa.Column('sub_table_name', sa.String(length=64), nullable=True, comment='关联子表的表名'),
                    sa.Column('sub_table_fk_name', sa.String(length=64), nullable=True, comment='子表关联的外键名'),
                    sa.Column('class_name', sa.String(length=100), server_default='', nullable=True,
                              comment='实体类名称'),
                    sa.Column('tpl_category', sa.String(length=200), server_default='crud', nullable=True,
                              comment='使用的模板（crud单表操作 tree树表操作）'),
                    sa.Column('tpl_web_type', sa.String(length=30), server_default='', nullable=True,
                              comment='前端模板类型（element-ui模版 element-plus模版）'),
                    sa.Column('package_name', sa.String(length=100), nullable=True, comment='生成包路径'),
                    sa.Column('module_name', sa.String(length=30), nullable=True, comment='生成模块名'),
                    sa.Column('business_name', sa.String(length=30), nullable=True, comment='生成业务名'),
                    sa.Column('function_name', sa.String(length=50), nullable=True, comment='生成功能名'),
                    sa.Column('function_author', sa.String(length=50), nullable=True, comment='生成功能作者'),
                    sa.Column('gen_type', sa.CHAR(length=1), server_default='0', nullable=True,
                              comment='生成代码方式（0zip压缩包 1自定义路径）'),
                    sa.Column('gen_path', sa.String(length=200), server_default='/', nullable=True,
                              comment='生成路径（不填默认项目路径）'),
                    sa.Column('options', sa.String(length=1000), nullable=True, comment='其它生成选项'),
                    sa.Column('create_by', sa.String(length=64), server_default='', nullable=True, comment='创建者'),
                    sa.Column('create_time', sa.DateTime(), nullable=True, comment='创建时间'),
                    sa.Column('update_by', sa.String(length=64), server_default='', nullable=True, comment='更新者'),
                    sa.Column('update_time', sa.DateTime(), nullable=True, comment='更新时间'),
                    sa.Column('remark', sa.String(length=500), nullable=True, comment='备注'),
                    sa.PrimaryKeyConstraint('table_id'),
                    comment='代码生成业务表'
                    )
    sys_config = op.create_table('sys_config',
                                 sa.Column('config_id', sa.Integer(), autoincrement=True, nullable=False,
                                           comment='参数主键'),
                                 sa.Column('config_name', sa.String(length=100), server_default='', nullable=True,
                                           comment='参数名称'),
                                 sa.Column('config_key', sa.String(length=100), server_default='', nullable=True,
                                           comment='参数键名'),
                                 sa.Column('config_value', sa.String(length=500), server_default='', nullable=True,
                                           comment='参数键值'),
                                 sa.Column('config_type', sa.CHAR(length=1), server_default='N', nullable=True,
                                           comment='系统内置（Y是 N否）'),
                                 sa.Column('create_by', sa.String(length=64), server_default='', nullable=True,
                                           comment='创建者'),
                                 sa.Column('create_time', sa.DateTime(), nullable=True, comment='创建时间'),
                                 sa.Column('update_by', sa.String(length=64), server_default='', nullable=True,
                                           comment='更新者'),
                                 sa.Column('update_time', sa.DateTime(), nullable=True, comment='更新时间'),
                                 sa.Column('remark', sa.String(length=500), nullable=True, comment='备注'),
                                 sa.PrimaryKeyConstraint('config_id'),
                                 comment='参数配置表'
                                 )

    op.bulk_insert(sys_config, [{
        "config_id": 1,
        "config_name": "主框架页-默认皮肤样式名称",
        "config_key": "sys.index.skinName",
        "config_value": "skin-blue",
        "config_type": "Y",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": "蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow"
    }, {
        "config_id": 2,
        "config_name": "用户管理-账号初始密码",
        "config_key": "sys.user.initPassword",
        "config_value": "123456",
        "config_type": "Y",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": "初始化密码 123456"
    }, {
        "config_id": 3,
        "config_name": "主框架页-侧边栏主题",
        "config_key": "sys.index.sideTheme",
        "config_value": "theme-dark",
        "config_type": "Y",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": "深色主题theme-dark，浅色主题theme-light"
    }, {
        "config_id": 4,
        "config_name": "账号自助-验证码开关",
        "config_key": "sys.account.captchaEnabled",
        "config_value": "true",
        "config_type": "Y",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": "是否开启验证码功能（true开启，false关闭）"
    }, {
        "config_id": 5,
        "config_name": "账号自助-是否开启用户注册功能",
        "config_key": "sys.account.registerUser",
        "config_value": "false",
        "config_type": "Y",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": "是否开启注册用户功能（true开启，false关闭）"
    }, {
        "config_id": 6,
        "config_name": "用户登录-黑名单列表",
        "config_key": "sys.login.blackIPList",
        "config_value": "",
        "config_type": "Y",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": "设置登录IP黑名单限制，多个匹配项以;分隔，支持匹配（*通配、网段）"
    }
    ])
    dept = op.create_table('sys_dept',
                           sa.Column('dept_id', sa.Integer(), autoincrement=True, nullable=False, comment='部门id'),
                           sa.Column('parent_id', sa.BigInteger(), server_default='0', nullable=True,
                                     comment='父部门id'),
                           sa.Column('ancestors', sa.String(length=50), server_default='', nullable=True,
                                     comment='祖级列表'),
                           sa.Column('dept_name', sa.String(length=30), server_default='', nullable=True,
                                     comment='部门名称'),
                           sa.Column('order_num', sa.Integer(), server_default='0', nullable=True, comment='显示顺序'),
                           sa.Column('leader', sa.String(length=20), nullable=True, comment='负责人'),
                           sa.Column('phone', sa.String(length=11), nullable=True, comment='联系电话'),
                           sa.Column('email', sa.String(length=50), nullable=True, comment='邮箱'),
                           sa.Column('status', sa.CHAR(length=1), server_default='0', nullable=True,
                                     comment='部门状态（0正常 1停用）'),
                           sa.Column('del_flag', sa.CHAR(length=1), server_default='0', nullable=True,
                                     comment='删除标志（0代表存在 2代表删除）'),
                           sa.Column('create_by', sa.String(length=64), server_default='', nullable=True,
                                     comment='创建者'),
                           sa.Column('create_time', sa.DateTime(), nullable=True, comment='创建时间'),
                           sa.Column('update_by', sa.String(length=64), server_default='', nullable=True,
                                     comment='更新者'),
                           sa.Column('update_time', sa.DateTime(), nullable=True, comment='更新时间'),
                           sa.PrimaryKeyConstraint('dept_id'),
                           comment='部门表'
                           )
    op.bulk_insert(dept, [{
        "dept_id": 1,
        "parent_id": 0,
        "ancestors": "0",
        "dept_name": "集团总公司",
        "order_num": 0,
        "leader": "年糕",
        "phone": "15888888888",
        "email": "niangao@qq.com",
        "status": "0",
        "del_flag": "0",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None
    }])
    dict_data = op.create_table('sys_dict_data',
                                sa.Column('dict_code', sa.Integer(), autoincrement=True, nullable=False,
                                          comment='字典编码'),
                                sa.Column('dict_sort', sa.Integer(), server_default='0', nullable=True,
                                          comment='字典排序'),
                                sa.Column('dict_label', sa.String(length=100), server_default='', nullable=True,
                                          comment='字典标签'),
                                sa.Column('dict_value', sa.String(length=100), server_default='', nullable=True,
                                          comment='字典键值'),
                                sa.Column('dict_type', sa.String(length=100), server_default='', nullable=True,
                                          comment='字典类型'),
                                sa.Column('css_class', sa.String(length=100), nullable=True,
                                          comment='样式属性（其他样式扩展）'),
                                sa.Column('list_class', sa.String(length=100), nullable=True, comment='表格回显样式'),
                                sa.Column('is_default', sa.CHAR(length=1), server_default='N', nullable=True,
                                          comment='是否默认（Y是 N否）'),
                                sa.Column('status', sa.CHAR(length=1), server_default='0', nullable=True,
                                          comment='状态（0正常 1停用）'),
                                sa.Column('create_by', sa.String(length=64), server_default='', nullable=True,
                                          comment='创建者'),
                                sa.Column('create_time', sa.DateTime(), nullable=True, comment='创建时间'),
                                sa.Column('update_by', sa.String(length=64), server_default='', nullable=True,
                                          comment='更新者'),
                                sa.Column('update_time', sa.DateTime(), nullable=True, comment='更新时间'),
                                sa.Column('remark', sa.String(length=500), nullable=True, comment='备注'),
                                sa.PrimaryKeyConstraint('dict_code'),
                                comment='字典数据表'
                                )
    op.bulk_insert(dict_data, [
        {
            "dict_code": 1,
            "dict_sort": 1,
            "dict_label": "男",
            "dict_value": "0",
            "dict_type": "sys_user_sex",
            "css_class": "",
            "list_class": "",
            "is_default": "Y",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "性别男"
        }, {
            "dict_code": 2,
            "dict_sort": 2,
            "dict_label": "女",
            "dict_value": "1",
            "dict_type": "sys_user_sex",
            "css_class": "",
            "list_class": "",
            "is_default": "N",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "性别女"
        }, {
            "dict_code": 3,
            "dict_sort": 3,
            "dict_label": "未知",
            "dict_value": "2",
            "dict_type": "sys_user_sex",
            "css_class": "",
            "list_class": "",
            "is_default": "N",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "性别未知"
        }, {
            "dict_code": 4,
            "dict_sort": 1,
            "dict_label": "显示",
            "dict_value": "0",
            "dict_type": "sys_show_hide",
            "css_class": "",
            "list_class": "primary",
            "is_default": "Y",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "显示菜单"
        }, {
            "dict_code": 5,
            "dict_sort": 2,
            "dict_label": "隐藏",
            "dict_value": "1",
            "dict_type": "sys_show_hide",
            "css_class": "",
            "list_class": "danger",
            "is_default": "N",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "隐藏菜单"
        }, {
            "dict_code": 6,
            "dict_sort": 1,
            "dict_label": "正常",
            "dict_value": "0",
            "dict_type": "sys_normal_disable",
            "css_class": "",
            "list_class": "primary",
            "is_default": "Y",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "正常状态"
        }, {
            "dict_code": 7,
            "dict_sort": 2,
            "dict_label": "停用",
            "dict_value": "1",
            "dict_type": "sys_normal_disable",
            "css_class": "",
            "list_class": "danger",
            "is_default": "N",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "停用状态"
        }, {
            "dict_code": 8,
            "dict_sort": 1,
            "dict_label": "正常",
            "dict_value": "0",
            "dict_type": "sys_job_status",
            "css_class": "",
            "list_class": "primary",
            "is_default": "Y",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "正常状态"
        }, {
            "dict_code": 9,
            "dict_sort": 2,
            "dict_label": "暂停",
            "dict_value": "1",
            "dict_type": "sys_job_status",
            "css_class": "",
            "list_class": "danger",
            "is_default": "N",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "停用状态"
        }, {
            "dict_code": 10,
            "dict_sort": 1,
            "dict_label": "默认",
            "dict_value": "default",
            "dict_type": "sys_job_group",
            "css_class": "",
            "list_class": "",
            "is_default": "Y",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "默认分组"
        }, {
            "dict_code": 11,
            "dict_sort": 2,
            "dict_label": "数据库",
            "dict_value": "sqlalchemy",
            "dict_type": "sys_job_group",
            "css_class": "",
            "list_class": "",
            "is_default": "N",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "数据库分组"
        }, {
            "dict_code": 12,
            "dict_sort": 3,
            "dict_label": "redis",
            "dict_value": "redis",
            "dict_type": "sys_job_group",
            "css_class": "",
            "list_class": "",
            "is_default": "N",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "reids分组"
        }, {
            "dict_code": 13,
            "dict_sort": 1,
            "dict_label": "默认",
            "dict_value": "default",
            "dict_type": "sys_job_executor",
            "css_class": "",
            "list_class": "",
            "is_default": "N",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "线程池"
        }, {
            "dict_code": 14,
            "dict_sort": 2,
            "dict_label": "进程池",
            "dict_value": "processpool",
            "dict_type": "sys_job_executor",
            "css_class": "",
            "list_class": "",
            "is_default": "N",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "进程池"
        }, {
            "dict_code": 15,
            "dict_sort": 1,
            "dict_label": "是",
            "dict_value": "Y",
            "dict_type": "sys_yes_no",
            "css_class": "",
            "list_class": "primary",
            "is_default": "Y",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "系统默认是"
        }, {
            "dict_code": 16,
            "dict_sort": 2,
            "dict_label": "否",
            "dict_value": "N",
            "dict_type": "sys_yes_no",
            "css_class": "",
            "list_class": "danger",
            "is_default": "N",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "系统默认否"
        }, {
            "dict_code": 17,
            "dict_sort": 1,
            "dict_label": "通知",
            "dict_value": "1",
            "dict_type": "sys_notice_type",
            "css_class": "",
            "list_class": "warning",
            "is_default": "Y",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "通知"
        }, {
            "dict_code": 18,
            "dict_sort": 2,
            "dict_label": "公告",
            "dict_value": "2",
            "dict_type": "sys_notice_type",
            "css_class": "",
            "list_class": "success",
            "is_default": "N",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "公告"
        }, {
            "dict_code": 19,
            "dict_sort": 1,
            "dict_label": "正常",
            "dict_value": "0",
            "dict_type": "sys_notice_status",
            "css_class": "",
            "list_class": "primary",
            "is_default": "Y",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "正常状态"
        }, {
            "dict_code": 20,
            "dict_sort": 2,
            "dict_label": "关闭",
            "dict_value": "1",
            "dict_type": "sys_notice_status",
            "css_class": "",
            "list_class": "danger",
            "is_default": "N",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "关闭状态"
        }, {
            "dict_code": 21,
            "dict_sort": 99,
            "dict_label": "其他",
            "dict_value": "0",
            "dict_type": "sys_oper_type",
            "css_class": "",
            "list_class": "info",
            "is_default": "N",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "其他操作"
        }, {
            "dict_code": 22,
            "dict_sort": 1,
            "dict_label": "新增",
            "dict_value": "1",
            "dict_type": "sys_oper_type",
            "css_class": "",
            "list_class": "info",
            "is_default": "N",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "新增操作"
        }, {
            "dict_code": 23,
            "dict_sort": 2,
            "dict_label": "修改",
            "dict_value": "2",
            "dict_type": "sys_oper_type",
            "css_class": "",
            "list_class": "info",
            "is_default": "N",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "修改操作"
        }, {
            "dict_code": 24,
            "dict_sort": 3,
            "dict_label": "删除",
            "dict_value": "3",
            "dict_type": "sys_oper_type",
            "css_class": "",
            "list_class": "danger",
            "is_default": "N",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "删除操作"
        }, {
            "dict_code": 25,
            "dict_sort": 4,
            "dict_label": "授权",
            "dict_value": "4",
            "dict_type": "sys_oper_type",
            "css_class": "",
            "list_class": "primary",
            "is_default": "N",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "授权操作"
        }, {
            "dict_code": 26,
            "dict_sort": 5,
            "dict_label": "导出",
            "dict_value": "5",
            "dict_type": "sys_oper_type",
            "css_class": "",
            "list_class": "warning",
            "is_default": "N",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "导出操作"
        }, {
            "dict_code": 27,
            "dict_sort": 6,
            "dict_label": "导入",
            "dict_value": "6",
            "dict_type": "sys_oper_type",
            "css_class": "",
            "list_class": "warning",
            "is_default": "N",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "导入操作"
        }, {
            "dict_code": 28,
            "dict_sort": 7,
            "dict_label": "强退",
            "dict_value": "7",
            "dict_type": "sys_oper_type",
            "css_class": "",
            "list_class": "danger",
            "is_default": "N",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "强退操作"
        }, {
            "dict_code": 29,
            "dict_sort": 8,
            "dict_label": "生成代码",
            "dict_value": "8",
            "dict_type": "sys_oper_type",
            "css_class": "",
            "list_class": "warning",
            "is_default": "N",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "生成操作"
        }, {
            "dict_code": 30,
            "dict_sort": 9,
            "dict_label": "清空数据",
            "dict_value": "9",
            "dict_type": "sys_oper_type",
            "css_class": "",
            "list_class": "danger",
            "is_default": "N",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "清空操作"
        }, {
            "dict_code": 31,
            "dict_sort": 1,
            "dict_label": "成功",
            "dict_value": "0",
            "dict_type": "sys_common_status",
            "css_class": "",
            "list_class": "primary",
            "is_default": "N",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "正常状态"
        }, {
            "dict_code": 32,
            "dict_sort": 2,
            "dict_label": "失败",
            "dict_value": "1",
            "dict_type": "sys_common_status",
            "css_class": "",
            "list_class": "danger",
            "is_default": "N",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "停用状态"
        }
    ])
    dict_type = op.create_table('sys_dict_type',
                                sa.Column('dict_id', sa.Integer(), autoincrement=True, nullable=False,
                                          comment='字典主键'),
                                sa.Column('dict_name', sa.String(length=100), server_default='', nullable=True,
                                          comment='字典名称'),
                                sa.Column('dict_type', sa.String(length=100), server_default='', nullable=True,
                                          comment='字典类型'),
                                sa.Column('status', sa.CHAR(length=1), server_default='0', nullable=True,
                                          comment='状态（0正常 1停用）'),
                                sa.Column('create_by', sa.String(length=64), server_default='', nullable=True,
                                          comment='创建者'),
                                sa.Column('create_time', sa.DateTime(), nullable=True, comment='创建时间'),
                                sa.Column('update_by', sa.String(length=64), server_default='', nullable=True,
                                          comment='更新者'),
                                sa.Column('update_time', sa.DateTime(), nullable=True, comment='更新时间'),
                                sa.Column('remark', sa.String(length=500), nullable=True, comment='备注'),
                                sa.PrimaryKeyConstraint('dict_id'),
                                sa.UniqueConstraint('dict_type'),
                                comment='字典类型表'
                                )
    op.bulk_insert(dict_type, [
        {
            "dict_id": 1,
            "dict_name": "用户性别",
            "dict_type": "sys_user_sex",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "用户性别列表"
        }, {
            "dict_id": 2,
            "dict_name": "菜单状态",
            "dict_type": "sys_show_hide",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "菜单状态列表"
        }, {
            "dict_id": 3,
            "dict_name": "系统开关",
            "dict_type": "sys_normal_disable",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "系统开关列表"
        }, {
            "dict_id": 4,
            "dict_name": "任务状态",
            "dict_type": "sys_job_status",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "任务状态列表"
        }, {
            "dict_id": 5,
            "dict_name": "任务分组",
            "dict_type": "sys_job_group",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "任务分组列表"
        }, {
            "dict_id": 6,
            "dict_name": "任务执行器",
            "dict_type": "sys_job_executor",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "任务执行器列表"
        }, {
            "dict_id": 7,
            "dict_name": "系统是否",
            "dict_type": "sys_yes_no",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "系统是否列表"
        }, {
            "dict_id": 8,
            "dict_name": "通知类型",
            "dict_type": "sys_notice_type",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "通知类型列表"
        }, {
            "dict_id": 9,
            "dict_name": "通知状态",
            "dict_type": "sys_notice_status",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "通知状态列表"
        }, {
            "dict_id": 10,
            "dict_name": "操作类型",
            "dict_type": "sys_oper_type",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "操作类型列表"
        }, {
            "dict_id": 11,
            "dict_name": "系统状态",
            "dict_type": "sys_common_status",
            "status": "0",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": "登录状态列表"
        }
    ])
    sys_job = op.create_table('sys_job',
                              sa.Column('job_id', sa.Integer(), autoincrement=True, nullable=False, comment='任务ID'),
                              sa.Column('job_name', sa.String(length=64), server_default='', nullable=False,
                                        comment='任务名称'),
                              sa.Column('job_group', sa.String(length=64), server_default='default', nullable=False,
                                        comment='任务组名'),
                              sa.Column('job_executor', sa.String(length=64), server_default='default', nullable=True,
                                        comment='任务执行器'),
                              sa.Column('invoke_target', sa.String(length=500), nullable=False,
                                        comment='调用目标字符串'),
                              sa.Column('job_args', sa.String(length=255), server_default='', nullable=True,
                                        comment='位置参数'),
                              sa.Column('job_kwargs', sa.String(length=255), server_default='', nullable=True,
                                        comment='关键字参数'),
                              sa.Column('cron_expression', sa.String(length=255), server_default='', nullable=True,
                                        comment='cron执行表达式'),
                              sa.Column('misfire_policy', sa.String(length=20), server_default='3', nullable=True,
                                        comment='计划执行错误策略（1立即执行 2执行一次 3放弃执行）'),
                              sa.Column('concurrent', sa.CHAR(length=1), server_default='1', nullable=True,
                                        comment='是否并发执行（0允许 1禁止）'),
                              sa.Column('status', sa.CHAR(length=1), server_default='0', nullable=True,
                                        comment='状态（0正常 1暂停）'),
                              sa.Column('create_by', sa.String(length=64), server_default='', nullable=True,
                                        comment='创建者'),
                              sa.Column('create_time', sa.DateTime(), nullable=True, comment='创建时间'),
                              sa.Column('update_by', sa.String(length=64), server_default='', nullable=True,
                                        comment='更新者'),
                              sa.Column('update_time', sa.DateTime(), nullable=True, comment='更新时间'),
                              sa.Column('remark', sa.String(length=500), server_default='', nullable=True,
                                        comment='备注信息'),
                              sa.PrimaryKeyConstraint('job_id'),
                              comment='定时任务调度表'
                              )
    op.bulk_insert(sys_job, [
        {
            "job_id": 1,
            "job_name": "系统默认（无参）",
            "job_group": "default",
            "job_executor": "default",
            "invoke_target": "module_task.scheduler_test.job",
            "job_args": "",
            "job_kwargs": "",
            "cron_expression": "0/10 * * * * ?",
            "misfire_policy": "3",
            "concurrent": "1",
            "status": "1",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": ""
        }, {
            "job_id": 2,
            "job_name": "系统默认（有参）",
            "job_group": "default",
            "job_executor": "default",
            "invoke_target": "module_task.scheduler_test.job",
            "job_args": "test",
            "job_kwargs": "",
            "cron_expression": "0/15 * * * * ?",
            "misfire_policy": "3",
            "concurrent": "1",
            "status": "1",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": ""
        }, {
            "job_id": 3,
            "job_name": "系统默认（多参）",
            "job_group": "default",
            "job_executor": "default",
            "invoke_target": "module_task.scheduler_test.job",
            "job_args": "new",
            "job_kwargs": "{\\\"test\\\": 111}",
            "cron_expression": "0/20 * * * * ?",
            "misfire_policy": "3",
            "concurrent": "1",
            "status": "1",
            "create_by": "admin",
            "create_time": date.today(),
            "update_by": "",
            "update_time": None,
            "remark": ""
        }
    ])
    op.create_table('sys_job_log',
                    sa.Column('job_log_id', sa.Integer(), autoincrement=True, nullable=False, comment='任务日志ID'),
                    sa.Column('job_name', sa.String(length=64), nullable=False, comment='任务名称'),
                    sa.Column('job_group', sa.String(length=64), nullable=False, comment='任务组名'),
                    sa.Column('job_executor', sa.String(length=64), nullable=False, comment='任务执行器'),
                    sa.Column('invoke_target', sa.String(length=500), nullable=False, comment='调用目标字符串'),
                    sa.Column('job_args', sa.String(length=255), server_default='', nullable=True, comment='位置参数'),
                    sa.Column('job_kwargs', sa.String(length=255), server_default='', nullable=True,
                              comment='关键字参数'),
                    sa.Column('job_trigger', sa.String(length=255), server_default='', nullable=True,
                              comment='任务触发器'),
                    sa.Column('job_message', sa.String(length=500), nullable=True, comment='日志信息'),
                    sa.Column('status', sa.CHAR(length=1), server_default='0', nullable=True,
                              comment='执行状态（0正常 1失败）'),
                    sa.Column('exception_info', sa.String(length=2000), server_default='', nullable=True,
                              comment='异常信息'),
                    sa.Column('create_time', sa.DateTime(), nullable=True, comment='创建时间'),
                    sa.PrimaryKeyConstraint('job_log_id'),
                    comment='定时任务调度日志表'
                    )
    op.create_table('sys_logininfor',
                    sa.Column('info_id', sa.Integer(), autoincrement=True, nullable=False, comment='访问ID'),
                    sa.Column('user_name', sa.String(length=50), server_default='', nullable=True, comment='用户账号'),
                    sa.Column('ipaddr', sa.String(length=128), server_default='', nullable=True, comment='登录IP地址'),
                    sa.Column('login_location', sa.String(length=255), server_default='', nullable=True,
                              comment='登录地点'),
                    sa.Column('browser', sa.String(length=50), server_default='', nullable=True, comment='浏览器类型'),
                    sa.Column('os', sa.String(length=50), server_default='', nullable=True, comment='操作系统'),
                    sa.Column('status', sa.CHAR(length=1), server_default='0', nullable=True,
                              comment='登录状态（0成功 1失败）'),
                    sa.Column('msg', sa.String(length=255), server_default='', nullable=True, comment='提示消息'),
                    sa.Column('login_time', sa.DateTime(), nullable=True, comment='访问时间'),
                    sa.PrimaryKeyConstraint('info_id'),
                    comment='系统访问记录'
                    )
    op.create_index('idx_sys_logininfor_lt', 'sys_logininfor', ['login_time'], unique=False)
    op.create_index('idx_sys_logininfor_s', 'sys_logininfor', ['status'], unique=False)
    menu = op.create_table('sys_menu',
                           sa.Column('menu_id', sa.Integer(), autoincrement=True, nullable=False, comment='菜单ID'),
                           sa.Column('menu_name', sa.String(length=50), nullable=False, comment='菜单名称'),
                           sa.Column('parent_id', sa.BigInteger(), server_default='0', nullable=True,
                                     comment='父菜单ID'),
                           sa.Column('order_num', sa.Integer(), server_default='0', nullable=True, comment='显示顺序'),
                           sa.Column('path', sa.String(length=200), server_default='', nullable=True,
                                     comment='路由地址'),
                           sa.Column('component', sa.String(length=255), nullable=True, comment='组件路径'),
                           sa.Column('query', sa.String(length=255), nullable=True, comment='路由参数'),
                           sa.Column('route_name', sa.String(length=50), server_default='', nullable=True,
                                     comment='路由名称'),
                           sa.Column('is_frame', sa.Integer(), server_default='1', nullable=True,
                                     comment='是否为外链（0是 1否）'),
                           sa.Column('is_cache', sa.Integer(), server_default='0', nullable=True,
                                     comment='是否缓存（0缓存 1不缓存）'),
                           sa.Column('menu_type', sa.CHAR(length=1), server_default='', nullable=True,
                                     comment='菜单类型（M目录 C菜单 F按钮）'),
                           sa.Column('visible', sa.CHAR(length=1), server_default='0', nullable=True,
                                     comment='菜单状态（0显示 1隐藏）'),
                           sa.Column('status', sa.CHAR(length=1), server_default='0', nullable=True,
                                     comment='菜单状态（0正常 1停用）'),
                           sa.Column('perms', sa.String(length=100), nullable=True, comment='权限标识'),
                           sa.Column('icon', sa.String(length=100), server_default='#', nullable=True,
                                     comment='菜单图标'),
                           sa.Column('create_by', sa.String(length=64), server_default='', nullable=True,
                                     comment='创建者'),
                           sa.Column('create_time', sa.DateTime(), nullable=True, comment='创建时间'),
                           sa.Column('update_by', sa.String(length=64), server_default='', nullable=True,
                                     comment='更新者'),
                           sa.Column('update_time', sa.DateTime(), nullable=True, comment='更新时间'),
                           sa.Column('remark', sa.String(length=500), server_default='', nullable=True, comment='备注'),
                           sa.PrimaryKeyConstraint('menu_id'),
                           comment='菜单权限表'
                           )
    op.bulk_insert(menu, [{
        "menu_id": 1,
        "menu_name": "系统管理",
        "parent_id": 0,
        "order_num": 1,
        "path": "system",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "M",
        "visible": "0",
        "status": "0",
        "perms": "",
        "icon": "system",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": "系统管理目录"
    }, {
        "menu_id": 2,
        "menu_name": "系统监控",
        "parent_id": 0,
        "order_num": 2,
        "path": "monitor",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "M",
        "visible": "0",
        "status": "0",
        "perms": "",
        "icon": "monitor",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": "系统监控目录"
    }, {
        "menu_id": 3,
        "menu_name": "系统工具",
        "parent_id": 0,
        "order_num": 3,
        "path": "tool",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "M",
        "visible": "0",
        "status": "0",
        "perms": "",
        "icon": "tool",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": "系统工具目录"
    }, {
        "menu_id": 4,
        "menu_name": "若依官网",
        "parent_id": 0,
        "order_num": 4,
        "path": "http://ruoyi.vip",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 0,
        "is_cache": 0,
        "menu_type": "M",
        "visible": "0",
        "status": "0",
        "perms": "",
        "icon": "guide",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": "若依官网地址"
    }, {
        "menu_id": 100,
        "menu_name": "用户管理",
        "parent_id": 1,
        "order_num": 1,
        "path": "user",
        "component": "system/user/index",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "C",
        "visible": "0",
        "status": "0",
        "perms": "system:user:list",
        "icon": "user",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": "用户管理菜单"
    }, {
        "menu_id": 101,
        "menu_name": "角色管理",
        "parent_id": 1,
        "order_num": 2,
        "path": "role",
        "component": "system/role/index",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "C",
        "visible": "0",
        "status": "0",
        "perms": "system:role:list",
        "icon": "peoples",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": "角色管理菜单"
    }, {
        "menu_id": 102,
        "menu_name": "菜单管理",
        "parent_id": 1,
        "order_num": 3,
        "path": "menu",
        "component": "system/menu/index",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "C",
        "visible": "0",
        "status": "0",
        "perms": "system:menu:list",
        "icon": "tree-table",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": "菜单管理菜单"
    }, {
        "menu_id": 103,
        "menu_name": "部门管理",
        "parent_id": 1,
        "order_num": 4,
        "path": "dept",
        "component": "system/dept/index",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "C",
        "visible": "0",
        "status": "0",
        "perms": "system:dept:list",
        "icon": "tree",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": "部门管理菜单"
    }, {
        "menu_id": 104,
        "menu_name": "岗位管理",
        "parent_id": 1,
        "order_num": 5,
        "path": "post",
        "component": "system/post/index",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "C",
        "visible": "0",
        "status": "0",
        "perms": "system:post:list",
        "icon": "post",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": "岗位管理菜单"
    }, {
        "menu_id": 105,
        "menu_name": "字典管理",
        "parent_id": 1,
        "order_num": 6,
        "path": "dict",
        "component": "system/dict/index",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "C",
        "visible": "0",
        "status": "0",
        "perms": "system:dict:list",
        "icon": "dict",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": "字典管理菜单"
    }, {
        "menu_id": 106,
        "menu_name": "参数设置",
        "parent_id": 1,
        "order_num": 7,
        "path": "config",
        "component": "system/config/index",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "C",
        "visible": "0",
        "status": "0",
        "perms": "system:config:list",
        "icon": "edit",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": "参数设置菜单"
    }, {
        "menu_id": 107,
        "menu_name": "通知公告",
        "parent_id": 1,
        "order_num": 8,
        "path": "notice",
        "component": "system/notice/index",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "C",
        "visible": "0",
        "status": "0",
        "perms": "system:notice:list",
        "icon": "message",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": "通知公告菜单"
    }, {
        "menu_id": 108,
        "menu_name": "日志管理",
        "parent_id": 1,
        "order_num": 9,
        "path": "log",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "M",
        "visible": "0",
        "status": "0",
        "perms": "",
        "icon": "log",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": "日志管理菜单"
    }, {
        "menu_id": 109,
        "menu_name": "在线用户",
        "parent_id": 2,
        "order_num": 1,
        "path": "online",
        "component": "monitor/online/index",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "C",
        "visible": "0",
        "status": "0",
        "perms": "monitor:online:list",
        "icon": "online",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": "在线用户菜单"
    }, {
        "menu_id": 110,
        "menu_name": "定时任务",
        "parent_id": 2,
        "order_num": 2,
        "path": "job",
        "component": "monitor/job/index",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "C",
        "visible": "0",
        "status": "0",
        "perms": "monitor:job:list",
        "icon": "job",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": "定时任务菜单"
    }, {
        "menu_id": 111,
        "menu_name": "数据监控",
        "parent_id": 2,
        "order_num": 3,
        "path": "druid",
        "component": "monitor/druid/index",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "C",
        "visible": "0",
        "status": "0",
        "perms": "monitor:druid:list",
        "icon": "druid",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": "数据监控菜单"
    }, {
        "menu_id": 112,
        "menu_name": "服务监控",
        "parent_id": 2,
        "order_num": 4,
        "path": "server",
        "component": "monitor/server/index",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "C",
        "visible": "0",
        "status": "0",
        "perms": "monitor:server:list",
        "icon": "server",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": "服务监控菜单"
    }, {
        "menu_id": 113,
        "menu_name": "缓存监控",
        "parent_id": 2,
        "order_num": 5,
        "path": "cache",
        "component": "monitor/cache/index",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "C",
        "visible": "0",
        "status": "0",
        "perms": "monitor:cache:list",
        "icon": "redis",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": "缓存监控菜单"
    }, {
        "menu_id": 114,
        "menu_name": "缓存列表",
        "parent_id": 2,
        "order_num": 6,
        "path": "cacheList",
        "component": "monitor/cache/list",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "C",
        "visible": "0",
        "status": "0",
        "perms": "monitor:cache:list",
        "icon": "redis-list",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": "缓存列表菜单"
    }, {
        "menu_id": 115,
        "menu_name": "表单构建",
        "parent_id": 3,
        "order_num": 1,
        "path": "build",
        "component": "tool/build/index",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "C",
        "visible": "0",
        "status": "0",
        "perms": "tool:build:list",
        "icon": "build",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": "表单构建菜单"
    }, {
        "menu_id": 116,
        "menu_name": "代码生成",
        "parent_id": 3,
        "order_num": 2,
        "path": "gen",
        "component": "tool/gen/index",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "C",
        "visible": "0",
        "status": "0",
        "perms": "tool:gen:list",
        "icon": "code",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": "代码生成菜单"
    }, {
        "menu_id": 117,
        "menu_name": "系统接口",
        "parent_id": 3,
        "order_num": 3,
        "path": "swagger",
        "component": "tool/swagger/index",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "C",
        "visible": "0",
        "status": "0",
        "perms": "tool:swagger:list",
        "icon": "swagger",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": "系统接口菜单"
    }, {
        "menu_id": 500,
        "menu_name": "操作日志",
        "parent_id": 108,
        "order_num": 1,
        "path": "operlog",
        "component": "monitor/operlog/index",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "C",
        "visible": "0",
        "status": "0",
        "perms": "monitor:operlog:list",
        "icon": "form",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": "操作日志菜单"
    }, {
        "menu_id": 501,
        "menu_name": "登录日志",
        "parent_id": 108,
        "order_num": 2,
        "path": "logininfor",
        "component": "monitor/logininfor/index",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "C",
        "visible": "0",
        "status": "0",
        "perms": "monitor:logininfor:list",
        "icon": "logininfor",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": "登录日志菜单"
    }, {
        "menu_id": 1000,
        "menu_name": "用户查询",
        "parent_id": 100,
        "order_num": 1,
        "path": "",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:user:query",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1001,
        "menu_name": "用户新增",
        "parent_id": 100,
        "order_num": 2,
        "path": "",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:user:add",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1002,
        "menu_name": "用户修改",
        "parent_id": 100,
        "order_num": 3,
        "path": "",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:user:edit",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1003,
        "menu_name": "用户删除",
        "parent_id": 100,
        "order_num": 4,
        "path": "",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:user:remove",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1004,
        "menu_name": "用户导出",
        "parent_id": 100,
        "order_num": 5,
        "path": "",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:user:export",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1005,
        "menu_name": "用户导入",
        "parent_id": 100,
        "order_num": 6,
        "path": "",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:user:import",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1006,
        "menu_name": "重置密码",
        "parent_id": 100,
        "order_num": 7,
        "path": "",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:user:resetPwd",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1007,
        "menu_name": "角色查询",
        "parent_id": 101,
        "order_num": 1,
        "path": "",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:role:query",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1008,
        "menu_name": "角色新增",
        "parent_id": 101,
        "order_num": 2,
        "path": "",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:role:add",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1009,
        "menu_name": "角色修改",
        "parent_id": 101,
        "order_num": 3,
        "path": "",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:role:edit",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1010,
        "menu_name": "角色删除",
        "parent_id": 101,
        "order_num": 4,
        "path": "",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:role:remove",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1011,
        "menu_name": "角色导出",
        "parent_id": 101,
        "order_num": 5,
        "path": "",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:role:export",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1012,
        "menu_name": "菜单查询",
        "parent_id": 102,
        "order_num": 1,
        "path": "",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:menu:query",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1013,
        "menu_name": "菜单新增",
        "parent_id": 102,
        "order_num": 2,
        "path": "",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:menu:add",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1014,
        "menu_name": "菜单修改",
        "parent_id": 102,
        "order_num": 3,
        "path": "",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:menu:edit",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1015,
        "menu_name": "菜单删除",
        "parent_id": 102,
        "order_num": 4,
        "path": "",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:menu:remove",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1016,
        "menu_name": "部门查询",
        "parent_id": 103,
        "order_num": 1,
        "path": "",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:dept:query",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1017,
        "menu_name": "部门新增",
        "parent_id": 103,
        "order_num": 2,
        "path": "",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:dept:add",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1018,
        "menu_name": "部门修改",
        "parent_id": 103,
        "order_num": 3,
        "path": "",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:dept:edit",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1019,
        "menu_name": "部门删除",
        "parent_id": 103,
        "order_num": 4,
        "path": "",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:dept:remove",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1020,
        "menu_name": "岗位查询",
        "parent_id": 104,
        "order_num": 1,
        "path": "",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:post:query",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1021,
        "menu_name": "岗位新增",
        "parent_id": 104,
        "order_num": 2,
        "path": "",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:post:add",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1022,
        "menu_name": "岗位修改",
        "parent_id": 104,
        "order_num": 3,
        "path": "",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:post:edit",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1023,
        "menu_name": "岗位删除",
        "parent_id": 104,
        "order_num": 4,
        "path": "",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:post:remove",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1024,
        "menu_name": "岗位导出",
        "parent_id": 104,
        "order_num": 5,
        "path": "",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:post:export",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1025,
        "menu_name": "字典查询",
        "parent_id": 105,
        "order_num": 1,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:dict:query",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1026,
        "menu_name": "字典新增",
        "parent_id": 105,
        "order_num": 2,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:dict:add",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1027,
        "menu_name": "字典修改",
        "parent_id": 105,
        "order_num": 3,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:dict:edit",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1028,
        "menu_name": "字典删除",
        "parent_id": 105,
        "order_num": 4,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:dict:remove",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1029,
        "menu_name": "字典导出",
        "parent_id": 105,
        "order_num": 5,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:dict:export",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1030,
        "menu_name": "参数查询",
        "parent_id": 106,
        "order_num": 1,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:config:query",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1031,
        "menu_name": "参数新增",
        "parent_id": 106,
        "order_num": 2,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:config:add",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1032,
        "menu_name": "参数修改",
        "parent_id": 106,
        "order_num": 3,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:config:edit",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1033,
        "menu_name": "参数删除",
        "parent_id": 106,
        "order_num": 4,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:config:remove",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1034,
        "menu_name": "参数导出",
        "parent_id": 106,
        "order_num": 5,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:config:export",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1035,
        "menu_name": "公告查询",
        "parent_id": 107,
        "order_num": 1,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:notice:query",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1036,
        "menu_name": "公告新增",
        "parent_id": 107,
        "order_num": 2,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:notice:add",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1037,
        "menu_name": "公告修改",
        "parent_id": 107,
        "order_num": 3,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:notice:edit",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1038,
        "menu_name": "公告删除",
        "parent_id": 107,
        "order_num": 4,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "system:notice:remove",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1039,
        "menu_name": "操作查询",
        "parent_id": 500,
        "order_num": 1,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "monitor:operlog:query",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1040,
        "menu_name": "操作删除",
        "parent_id": 500,
        "order_num": 2,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "monitor:operlog:remove",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1041,
        "menu_name": "日志导出",
        "parent_id": 500,
        "order_num": 3,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "monitor:operlog:export",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1042,
        "menu_name": "登录查询",
        "parent_id": 501,
        "order_num": 1,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "monitor:logininfor:query",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1043,
        "menu_name": "登录删除",
        "parent_id": 501,
        "order_num": 2,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "monitor:logininfor:remove",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1044,
        "menu_name": "日志导出",
        "parent_id": 501,
        "order_num": 3,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "monitor:logininfor:export",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1045,
        "menu_name": "账户解锁",
        "parent_id": 501,
        "order_num": 4,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "monitor:logininfor:unlock",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1046,
        "menu_name": "在线查询",
        "parent_id": 109,
        "order_num": 1,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "monitor:online:query",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1047,
        "menu_name": "批量强退",
        "parent_id": 109,
        "order_num": 2,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "monitor:online:batchLogout",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1048,
        "menu_name": "单条强退",
        "parent_id": 109,
        "order_num": 3,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "monitor:online:forceLogout",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1049,
        "menu_name": "任务查询",
        "parent_id": 110,
        "order_num": 1,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "monitor:job:query",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1050,
        "menu_name": "任务新增",
        "parent_id": 110,
        "order_num": 2,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "monitor:job:add",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1051,
        "menu_name": "任务修改",
        "parent_id": 110,
        "order_num": 3,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "monitor:job:edit",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1052,
        "menu_name": "任务删除",
        "parent_id": 110,
        "order_num": 4,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "monitor:job:remove",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1053,
        "menu_name": "状态修改",
        "parent_id": 110,
        "order_num": 5,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "monitor:job:changeStatus",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1054,
        "menu_name": "任务导出",
        "parent_id": 110,
        "order_num": 6,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "monitor:job:export",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1055,
        "menu_name": "生成查询",
        "parent_id": 116,
        "order_num": 1,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "tool:gen:query",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1056,
        "menu_name": "生成修改",
        "parent_id": 116,
        "order_num": 2,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "tool:gen:edit",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1057,
        "menu_name": "生成删除",
        "parent_id": 116,
        "order_num": 3,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "tool:gen:remove",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1058,
        "menu_name": "导入代码",
        "parent_id": 116,
        "order_num": 4,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "tool:gen:import",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1059,
        "menu_name": "预览代码",
        "parent_id": 116,
        "order_num": 5,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "tool:gen:preview",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }, {
        "menu_id": 1060,
        "menu_name": "生成代码",
        "parent_id": 116,
        "order_num": 6,
        "path": "#",
        "component": "",
        "query": "",
        "route_name": "",
        "is_frame": 1,
        "is_cache": 0,
        "menu_type": "F",
        "visible": "0",
        "status": "0",
        "perms": "tool:gen:code",
        "icon": "#",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": ""
    }])
    op.create_table('sys_notice',
                    sa.Column('notice_id', sa.Integer(), autoincrement=True, nullable=False, comment='公告ID'),
                    sa.Column('notice_title', sa.String(length=50), nullable=False, comment='公告标题'),
                    sa.Column('notice_type', sa.CHAR(length=1), nullable=False, comment='公告类型（1通知 2公告）'),
                    sa.Column('notice_content', sa.LargeBinary(), nullable=True, comment='公告内容'),
                    sa.Column('status', sa.CHAR(length=1), server_default='0', nullable=True,
                              comment='公告状态（0正常 1关闭）'),
                    sa.Column('create_by', sa.String(length=64), server_default='', nullable=True, comment='创建者'),
                    sa.Column('create_time', sa.DateTime(), nullable=True, comment='创建时间'),
                    sa.Column('update_by', sa.String(length=64), server_default='', nullable=True, comment='更新者'),
                    sa.Column('update_time', sa.DateTime(), nullable=True, comment='更新时间'),
                    sa.Column('remark', sa.String(length=255), nullable=True, comment='备注'),
                    sa.PrimaryKeyConstraint('notice_id'),
                    comment='通知公告表'
                    )
    op.create_table('sys_oper_log',
                    sa.Column('oper_id', sa.Integer(), autoincrement=True, nullable=False, comment='日志主键'),
                    sa.Column('title', sa.String(length=50), server_default='', nullable=True, comment='模块标题'),
                    sa.Column('business_type', sa.Integer(), server_default='0', nullable=True,
                              comment='业务类型（0其它 1新增 2修改 3删除）'),
                    sa.Column('method', sa.String(length=100), server_default='', nullable=True, comment='方法名称'),
                    sa.Column('request_method', sa.String(length=10), server_default='', nullable=True,
                              comment='请求方式'),
                    sa.Column('operator_type', sa.Integer(), server_default='0', nullable=True,
                              comment='操作类别（0其它 1后台用户 2手机端用户）'),
                    sa.Column('oper_name', sa.String(length=50), server_default='', nullable=True, comment='操作人员'),
                    sa.Column('dept_name', sa.String(length=50), server_default='', nullable=True, comment='部门名称'),
                    sa.Column('oper_url', sa.String(length=255), server_default='', nullable=True, comment='请求URL'),
                    sa.Column('oper_ip', sa.String(length=128), server_default='', nullable=True, comment='主机地址'),
                    sa.Column('oper_location', sa.String(length=255), server_default='', nullable=True,
                              comment='操作地点'),
                    sa.Column('oper_param', sa.String(length=2000), server_default='', nullable=True,
                              comment='请求参数'),
                    sa.Column('json_result', sa.String(length=2000), server_default='', nullable=True,
                              comment='返回参数'),
                    sa.Column('status', sa.Integer(), server_default='0', nullable=True,
                              comment='操作状态（0正常 1异常）'),
                    sa.Column('error_msg', sa.String(length=2000), server_default='', nullable=True,
                              comment='错误消息'),
                    sa.Column('oper_time', sa.DateTime(), nullable=True, comment='操作时间'),
                    sa.Column('cost_time', sa.BigInteger(), server_default='0', nullable=True, comment='消耗时间'),
                    sa.PrimaryKeyConstraint('oper_id'),
                    comment='操作日志记录'
                    )
    op.create_index('idx_sys_oper_log_bt', 'sys_oper_log', ['business_type'], unique=False)
    op.create_index('idx_sys_oper_log_ot', 'sys_oper_log', ['oper_time'], unique=False)
    op.create_index('idx_sys_oper_log_s', 'sys_oper_log', ['status'], unique=False)
    op.create_table('sys_post',
                    sa.Column('post_id', sa.Integer(), autoincrement=True, nullable=False, comment='岗位ID'),
                    sa.Column('post_code', sa.String(length=64), nullable=False, comment='岗位编码'),
                    sa.Column('post_name', sa.String(length=50), nullable=False, comment='岗位名称'),
                    sa.Column('post_sort', sa.Integer(), nullable=False, comment='显示顺序'),
                    sa.Column('status', sa.CHAR(length=1), nullable=False, comment='状态（0正常 1停用）'),
                    sa.Column('create_by', sa.String(length=64), server_default='', nullable=True, comment='创建者'),
                    sa.Column('create_time', sa.DateTime(), nullable=True, comment='创建时间'),
                    sa.Column('update_by', sa.String(length=64), server_default='', nullable=True, comment='更新者'),
                    sa.Column('update_time', sa.DateTime(), nullable=True, comment='更新时间'),
                    sa.Column('remark', sa.String(length=500), nullable=True, comment='备注'),
                    sa.PrimaryKeyConstraint('post_id'),
                    comment='岗位信息表'
                    )
    role = op.create_table('sys_role',
                           sa.Column('role_id', sa.Integer(), autoincrement=True, nullable=False, comment='角色ID'),
                           sa.Column('role_name', sa.String(length=30), nullable=False, comment='角色名称'),
                           sa.Column('role_key', sa.String(length=100), nullable=False, comment='角色权限字符串'),
                           sa.Column('role_sort', sa.Integer(), nullable=False, comment='显示顺序'),
                           sa.Column('data_scope', sa.CHAR(length=1), server_default='1', nullable=True,
                                     comment='数据范围（1：全部数据权限 2：自定数据权限 3：本部门数据权限 4：本部门及以下数据权限）'),
                           sa.Column('menu_check_strictly', sa.SmallInteger(), server_default='1', nullable=True,
                                     comment='菜单树选择项是否关联显示'),
                           sa.Column('dept_check_strictly', sa.SmallInteger(), server_default='1', nullable=True,
                                     comment='部门树选择项是否关联显示'),
                           sa.Column('status', sa.CHAR(length=1), nullable=False, comment='角色状态（0正常 1停用）'),
                           sa.Column('del_flag', sa.CHAR(length=1), server_default='0', nullable=True,
                                     comment='删除标志（0代表存在 2代表删除）'),
                           sa.Column('create_by', sa.String(length=64), server_default='', nullable=True,
                                     comment='创建者'),
                           sa.Column('create_time', sa.DateTime(), nullable=True, comment='创建时间'),
                           sa.Column('update_by', sa.String(length=64), server_default='', nullable=True,
                                     comment='更新者'),
                           sa.Column('update_time', sa.DateTime(), nullable=True, comment='更新时间'),
                           sa.Column('remark', sa.String(length=500), nullable=True, comment='备注'),
                           sa.PrimaryKeyConstraint('role_id'),
                           comment='角色信息表'
                           )
    op.bulk_insert(role, [{
        "role_id": 1,
        "role_name": "超级管理员",
        "role_key": "admin",
        "role_sort": 1,
        "data_scope": "1",
        "menu_check_strictly": 1,
        "dept_check_strictly": 1,
        "status": "0",
        "del_flag": "0",
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": "超级管理员"
    }])
    op.create_table('sys_role_dept',
                    sa.Column('role_id', sa.BigInteger(), nullable=False, comment='角色ID'),
                    sa.Column('dept_id', sa.BigInteger(), nullable=False, comment='部门ID'),
                    sa.PrimaryKeyConstraint('role_id', 'dept_id'),
                    comment='角色和部门关联表'
                    )
    op.create_table('sys_role_menu',
                    sa.Column('role_id', sa.BigInteger(), nullable=False, comment='角色ID'),
                    sa.Column('menu_id', sa.BigInteger(), nullable=False, comment='菜单ID'),
                    sa.PrimaryKeyConstraint('role_id', 'menu_id'),
                    comment='角色和菜单关联表'
                    )
    user = op.create_table('sys_user',
                           sa.Column('user_id', sa.Integer(), autoincrement=True, nullable=False, comment='用户ID'),
                           sa.Column('dept_id', sa.BigInteger(), nullable=True, comment='部门ID'),
                           sa.Column('user_name', sa.String(length=30), nullable=False, comment='用户账号'),
                           sa.Column('nick_name', sa.String(length=30), nullable=False, comment='用户昵称'),
                           sa.Column('user_type', sa.String(length=2), server_default='00', nullable=True,
                                     comment='用户类型（00系统用户）'),
                           sa.Column('email', sa.String(length=50), server_default='', nullable=True,
                                     comment='用户邮箱'),
                           sa.Column('phonenumber', sa.String(length=11), server_default='', nullable=True,
                                     comment='手机号码'),
                           sa.Column('sex', sa.CHAR(length=1), server_default='0', nullable=True,
                                     comment='用户性别（0男 1女 2未知）'),
                           sa.Column('avatar', sa.String(length=100), server_default='', nullable=True,
                                     comment='头像地址'),
                           sa.Column('password', sa.String(length=100), server_default='', nullable=True,
                                     comment='密码'),
                           sa.Column('status', sa.CHAR(length=1), server_default='0', nullable=True,
                                     comment='帐号状态（0正常 1停用）'),
                           sa.Column('del_flag', sa.CHAR(length=1), server_default='0', nullable=True,
                                     comment='删除标志（0代表存在 2代表删除）'),
                           sa.Column('login_ip', sa.String(length=128), server_default='', nullable=True,
                                     comment='最后登录IP'),
                           sa.Column('login_date', sa.DateTime(), nullable=True, comment='最后登录时间'),
                           sa.Column('pwd_update_date', sa.DateTime(), nullable=True, comment='密码最后更新时间'),
                           sa.Column('create_by', sa.String(length=64), server_default='', nullable=True,
                                     comment='创建者'),
                           sa.Column('create_time', sa.DateTime(), nullable=True, comment='创建时间'),
                           sa.Column('update_by', sa.String(length=64), server_default='', nullable=True,
                                     comment='更新者'),
                           sa.Column('update_time', sa.DateTime(), nullable=True, comment='更新时间'),
                           sa.Column('remark', sa.String(length=500), nullable=True, comment='备注'),
                           sa.PrimaryKeyConstraint('user_id'),
                           comment='用户信息表'
                           )
    op.bulk_insert(user, [{
        "user_id": 1,
        "dept_id": 1,
        "user_name": "admin",
        "nick_name": "超级管理员",
        "user_type": "00",
        "email": "niangao@163.com",
        "phonenumber": "15888888888",
        "sex": "1",
        "avatar": "",
        "password": "$2b$12$z4aruUjtsuR9iEah.flwvesc9r/Li0.MB0I6/3e9gwAp7a3VWlMjG",
        "status": "0",
        "del_flag": "0",
        "login_ip": "",
        "login_date": None,
        "pwd_update_date": None,
        "create_by": "admin",
        "create_time": date.today(),
        "update_by": "",
        "update_time": None,
        "remark": "管理员"
    }])
    op.create_table('sys_user_post',
                    sa.Column('user_id', sa.BigInteger(), nullable=False, comment='用户ID'),
                    sa.Column('post_id', sa.BigInteger(), nullable=False, comment='岗位ID'),
                    sa.PrimaryKeyConstraint('user_id', 'post_id'),
                    comment='用户与岗位关联表'
                    )
    user_role = op.create_table('sys_user_role',
                                sa.Column('user_id', sa.BigInteger(), nullable=False, comment='用户ID'),
                                sa.Column('role_id', sa.BigInteger(), nullable=False, comment='角色ID'),
                                sa.PrimaryKeyConstraint('user_id', 'role_id'),
                                comment='用户和角色关联表'
                                )
    op.bulk_insert(user_role, [{"user_id": 1, "role_id": 1}])
    op.create_table('gen_table_column',
                    sa.Column('column_id', sa.Integer(), autoincrement=True, nullable=False, comment='编号'),
                    sa.Column('table_id', sa.BigInteger(), nullable=True, comment='归属表编号'),
                    sa.Column('column_name', sa.String(length=200), nullable=True, comment='列名称'),
                    sa.Column('column_comment', sa.String(length=500), nullable=True, comment='列描述'),
                    sa.Column('column_type', sa.String(length=100), nullable=True, comment='列类型'),
                    sa.Column('python_type', sa.String(length=500), nullable=True, comment='PYTHON类型'),
                    sa.Column('python_field', sa.String(length=200), nullable=True, comment='PYTHON字段名'),
                    sa.Column('is_pk', sa.CHAR(length=1), nullable=True, comment='是否主键（1是）'),
                    sa.Column('is_increment', sa.CHAR(length=1), nullable=True, comment='是否自增（1是）'),
                    sa.Column('is_required', sa.CHAR(length=1), nullable=True, comment='是否必填（1是）'),
                    sa.Column('is_unique', sa.CHAR(length=1), nullable=True, comment='是否唯一（1是）'),
                    sa.Column('is_insert', sa.CHAR(length=1), nullable=True, comment='是否为插入字段（1是）'),
                    sa.Column('is_edit', sa.CHAR(length=1), nullable=True, comment='是否编辑字段（1是）'),
                    sa.Column('is_list', sa.CHAR(length=1), nullable=True, comment='是否列表字段（1是）'),
                    sa.Column('is_query', sa.CHAR(length=1), nullable=True, comment='是否查询字段（1是）'),
                    sa.Column('query_type', sa.String(length=200), server_default='EQ', nullable=True,
                              comment='查询方式（等于、不等于、大于、小于、范围）'),
                    sa.Column('html_type', sa.String(length=200), nullable=True,
                              comment='显示类型（文本框、文本域、下拉框、复选框、单选框、日期控件）'),
                    sa.Column('dict_type', sa.String(length=200), server_default='', nullable=True, comment='字典类型'),
                    sa.Column('sort', sa.Integer(), nullable=True, comment='排序'),
                    sa.Column('create_by', sa.String(length=64), server_default='', nullable=True, comment='创建者'),
                    sa.Column('create_time', sa.DateTime(), nullable=True, comment='创建时间'),
                    sa.Column('update_by', sa.String(length=64), server_default='', nullable=True, comment='更新者'),
                    sa.Column('update_time', sa.DateTime(), nullable=True, comment='更新时间'),
                    sa.ForeignKeyConstraint(['table_id'], ['gen_table.table_id'], ),
                    sa.PrimaryKeyConstraint('column_id'),
                    comment='代码生成业务表字段'
                    )
    # ### end Alembic commands ###


def downgrade() -> None:
    """Downgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('gen_table_column')
    op.drop_table('sys_user_role')
    op.drop_table('sys_user_post')
    op.drop_table('sys_user')
    op.drop_table('sys_role_menu')
    op.drop_table('sys_role_dept')
    op.drop_table('sys_role')
    op.drop_table('sys_post')
    op.drop_index('idx_sys_oper_log_s', table_name='sys_oper_log')
    op.drop_index('idx_sys_oper_log_ot', table_name='sys_oper_log')
    op.drop_index('idx_sys_oper_log_bt', table_name='sys_oper_log')
    op.drop_table('sys_oper_log')
    op.drop_table('sys_notice')
    op.drop_table('sys_menu')
    op.drop_index('idx_sys_logininfor_s', table_name='sys_logininfor')
    op.drop_index('idx_sys_logininfor_lt', table_name='sys_logininfor')
    op.drop_table('sys_logininfor')
    op.drop_table('sys_job_log')
    op.drop_table('sys_job')
    op.drop_table('sys_dict_type')
    op.drop_table('sys_dict_data')
    op.drop_table('sys_dept')
    op.drop_table('sys_config')
    op.drop_table('gen_table')
    op.drop_index('ix_apscheduler_jobs_next_run_time', table_name='apscheduler_jobs')
    op.drop_table('apscheduler_jobs')
    # ### end Alembic commands ###
